﻿#if UNITY
using UnityEngine;

namespace con.susi.util
{
    public static class GameObjectExtensions
    {
        public static T AddOrGetComponent<T>(this GameObject go) where T : Component
        {
            T t = go.GetComponent<T>();
            if (t == null)
            {
                t = go.AddComponent<T>();
            }
            return t;
        }
    }
}
#endif